/**
 * Project Name:cnsy-url-short-service
 * File Name:SimpleDefaultObjectMapper.java
 * Package Name:cn.cnsy123.shorturls.business.component 
 * Date: 2020年4月27日-下午2:25:24
 * Copyright (c) 2020, yangpengfei@360@126.com All Rights Reserved. 
 *
 */

package cn.cnsy123.shorturls.business.component;

import java.text.SimpleDateFormat;
import java.util.TimeZone;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

/**
 * ClassName: SimpleDefaultObjectMapper
 * 
 * @author yangpengfei
 * @date 2020年4月27日-下午2:25:24
 * @version 1.0
 * @since JDK 1.7
 */
public class SimpleDefaultObjectMapper extends ObjectMapper {

    private static final String YYYYMMDD_HHMMSS = "yyyy-MM-dd HH:mm:ss";
    
    private static final String TIME_ZONE_EAST_EIGHT = "GMT+8";
    
    /**
     * serialVersionUID:TODO(用一句话描述这个变量表示什么). 
     * @since JDK 1.7
     */
    private static final long serialVersionUID = 526062613353808501L;

    public SimpleDefaultObjectMapper() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(YYYYMMDD_HHMMSS);
        simpleDateFormat.setTimeZone(TimeZone.getTimeZone(TIME_ZONE_EAST_EIGHT));
        this.setDateFormat(simpleDateFormat);
        this.setSerializationInclusion(Include.ALWAYS);
        this.configure(Feature.ALLOW_SINGLE_QUOTES, Boolean.TRUE.booleanValue());
        this.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, Boolean.TRUE.booleanValue());
    }
    
    

}
